/* 
 * 智慧粮仓能耗检测界面 - 样式表
 * 遵循Android平板UI设计规范
 */

/* 引用公共样式 */
@import url('../css/common.css');

:root {
  /* 颜色系统 */
  --color-primary: #001529;         /* 深蓝色主背景 */
  --color-primary-light: #1890FF;   /* 蓝色按钮和强调色 */
  --color-text-light: #FFFFFF;      /* 深色背景上的文字 */
  --color-card-bg: #032140;         /* 卡片背景 */
  --color-card-bg-darker: #021B36;  /* 更深的卡片背景 */
  --color-status-normal: #52C41A;   /* 正常状态 */
  --color-status-warning: #FAAD14;  /* 警告状态 */
  --color-status-error: #F5222D;    /* 错误状态 */
  
  /* 尺寸规范 */
  --spacing-xs: 8px;
  --spacing-sm: 16px;
  --spacing-md: 24px;
  --spacing-lg: 32px;
  --spacing-xl: 48px;
  
  /* 圆角 */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;
  
  /* 阴影 */
  --shadow-card: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* 基础样式 */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  height: 100vh;
  font-family: Roboto, "SF Pro", -apple-system, BlinkMacSystemFont, sans-serif;
  background: linear-gradient(130deg, var(--theme-gradient-start) 0%, var(--theme-gradient-end) 100%);
  color: var(--theme-text-color) !important;
  overflow: hidden;
  line-height: 1.4;
  padding: 0;
  margin: 0;
}

/* 为所有文本元素强制设置颜色 */
body, div, p, span, button, li, a:not(.layui-btn), .layui-tab-title li {
  color: var(--theme-text-color) !important;
}

/* 头部样式 */
header {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-sm) var(--spacing-md);
  background-color: var(--color-primary);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

header > div:first-child {
  font-size: 24px;
  font-weight: bold;
}

header .today {
  text-align: right;
}

header .today .date,
header .today .time {
  font-size: 16px;
  line-height: 1.4;
}

/* 主内容区域 */
main {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: transparent;
}

/* 选项卡 */
.layui-tab {
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  background: transparent;
  border-radius: 0;
  border: none;
  box-shadow: none;
}

.layui-tab-title {
  height: 48px;
  background: transparent;
  border-color: var(--theme-card-border) !important;
}

.layui-tab-title li {
  color: rgba(255, 255, 255, 0.7) !important;
  font-size: 15px;
  font-weight: 500;
  padding: 0 20px;
}

.layui-tab-title .layui-this {
  color: var(--theme-text-color) !important;
  font-weight: 600;
}

.layui-tab-title .layui-this:after {
  height: 3px !important;
  background-color: #1976D2 !important;
  border: none;
}

.layui-tab-content {
  flex: 1;
  padding: 0;
  overflow-y: auto;
}

.layui-tab-item {
  height: 100%;
}

/* 电力监测内容 */
#power-monitoring-content {
  padding: 0;
}

/* 电力监测标题 */
.section-title {
  font-size: 16px;
  font-weight: 500;
  color: #FFFFFF;
  padding: 12px 16px;
  background-color: rgba(0, 21, 41, 0.6);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

/* 电力监测概览卡片 */
.power-overview-summary {
  margin-bottom: 0;
  padding: 0;
  background-color: transparent;
}

.overview-title {
  font-size: 16px;
  font-weight: 500;
  color: var(--theme-text-color) !important;
  padding: 12px 16px;
  border-bottom: 1px solid var(--theme-card-border);
}

.summary-row {
  display: flex;
  flex-direction: row;
  justify-content: flex-start;
  align-items: center;
  margin-bottom: 0;
  padding: 16px;
  gap: 30px;
}

.summary-item {
  display: flex;
  flex-direction: column;
  padding: 0;
  align-items: flex-start;
  min-width: 100px;
}

.summary-label {
  font-size: 14px;
  color: var(--theme-text-color) !important;
  margin-bottom: 8px;
  text-align: left;
}

.summary-value {
  font-size: 20px;
  font-weight: 600;
  color: var(--theme-text-color) !important;
  text-align: left;
}

/* 电力测点列表 */
.power-data-list {
  list-style: none;
  padding: 16px;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 12px;
}

.power-data-list li {
  list-style: none;
}

.power-point {
  padding: 16px;
  /* background: var(--theme-card-bg); */
  border: 1px solid var(--theme-card-border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.power-point:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 16px var(--theme-card-shadow);
}

.point-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.point-name {
  font-size: 14px;
  font-weight: normal;
  color: var(--theme-text-color) !important;
  display: flex;
  align-items: center;
  gap: 6px;
}

.point-name i {
  color: #1890FF;
  font-size: 16px;
}

.point-status {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--color-status-normal);
}

.point-status.warning {
  background-color: var(--color-status-warning);
}

.point-status.danger {
  background-color: var(--color-status-error);
}

.point-value {
  font-size: 32px;
  font-weight: 600;
  color: var(--theme-text-color) !important;
  margin: 8px 0;
}

.point-unit {
  font-size: 16px;
  font-weight: 400;
  color: var(--theme-text-color) !important;
  opacity: 0.8;
  margin-left: 2px;
}

.point-time {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5) !important;
  margin-top: 8px;
}

/* 刷新按钮位置和样式 */
.refresh-button {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  background-color: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  z-index: 10;
}

.refresh-button i {
  color: white;
  font-size: 16px;
}

/* 确保适配小屏幕设备 */
@media (max-width: 768px) {
  .overview-stats {
    flex-direction: column;
  }
  
  .power-data-list {
    grid-template-columns: 1fr;
  }
}